package de.tabuma.formcreator.logik;

import de.tabuma.formcreator.entity.*;
import java.util.logging.*;
import java.util.*;

/**
 * @author $Author: $
 * @version $Revision: $
 * @since $Date: $
 */
public class BreadcrumpsFacade {
    private static final Logger log = Logger.getLogger(BreadcrumpsFacade.class.getName());

    public static String printBreadcrumps(FormStructur formStructur) {
        String str = "<div class=\"breadcrumps\">";

        List<FormStructur> breadcrumps = formStructur.getBreadcrumps();
        for(int i=0;i<breadcrumps.size();i++) {
            if(i!=0) {
                str += " > ";
            }
            FormStructur fs = breadcrumps.get(i);
            if(i!=breadcrumps.size()-1) {
                str += "<a href=\"javascript:parent.printView"+fs.getId()+"()\">"+fs.getName()+"</a>";
            }
            else {
                str += fs.getName();
            }
        }
        str += "</div>";
        return str;
    }
}